package day04;
//Math.rcanner()生成随机数
import java.util.Scanner;

public class Guessing {
    public static void main(String[] args) {
        //需求:
        Scanner sc=new Scanner(System.in);
        int num=(int)(Math.random()*1000+1);
        System.out.println(num);
        System.out.println("猜吧");
        int guess=sc.nextInt();//自己输入一个数

        while (guess!=num){//判断guess是否=num,如果!=则执行循环语句
            if (guess>num ) {
                System.out.println("偏大");
            }else{
                System.out.println("偏小");
            }
            System.out.println("继续猜吧");
            guess=sc.nextInt();//重新接收输入的数
        }

        System.out.println("恭喜你");
    }
}
